package Vista;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import Controlador.ControEstudiante;
import Controlador.ControProfesor;


public class Vprofesor extends javax.swing.JFrame {
	public JPanel panelprof;
	public JLabel lblnom;
	public JTextField txttitulo;
	public JLabel lbltitulo;
	public JButton btnasi;
	public JTextField txtape;
	public JTextField txtnom;
	public JTextField txtcedula;
	public JLabel lblape;
	public JLabel lblcedula;

	
	public Vprofesor() {
		super();
		initGUI();
	}
	private ControProfesor controp;
	
	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				panelprof = new JPanel();
				GroupLayout panelprofLayout = new GroupLayout((JComponent)panelprof);
				panelprof.setLayout(panelprofLayout);
				{
					lblcedula = new JLabel();
					lblcedula.setText("Cedula:");
				}
				{
					lbltitulo = new JLabel();
					lbltitulo.setText("Titulo Academico");
				}
				{
					txttitulo = new JTextField();
				}
				{
					lblape = new JLabel();
					lblape.setText("Apellido:");
				}
				{
					lblnom = new JLabel();
					lblnom.setText("Nombre:");
				}
				{
					txtcedula = new JTextField();
				}
				{
					txtnom = new JTextField();
				}
				{
					txtape = new JTextField();
				}
				{
					btnasi = new JButton();
					btnasi.setText("Asignar");
				}
					panelprofLayout.setHorizontalGroup(panelprofLayout.createSequentialGroup()
					.addContainerGap(37, 37)
					.addGroup(panelprofLayout.createParallelGroup()
					    .addGroup(GroupLayout.Alignment.LEADING, panelprofLayout.createSequentialGroup()
					        .addComponent(lbltitulo, GroupLayout.PREFERRED_SIZE, 133, GroupLayout.PREFERRED_SIZE)
					        .addGap(24)
					        .addGroup(panelprofLayout.createParallelGroup()
					            .addGroup(panelprofLayout.createSequentialGroup()
					                .addComponent(txttitulo, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 0, Short.MAX_VALUE))
					            .addGroup(panelprofLayout.createSequentialGroup()
					                .addComponent(txtape, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 0, Short.MAX_VALUE))
					            .addGroup(panelprofLayout.createSequentialGroup()
					                .addComponent(txtnom, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 0, Short.MAX_VALUE))
					            .addGroup(GroupLayout.Alignment.LEADING, panelprofLayout.createSequentialGroup()
					                .addComponent(txtcedula, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 14, Short.MAX_VALUE))))
					    .addGroup(panelprofLayout.createSequentialGroup()
					        .addGap(24)
					        .addGroup(panelprofLayout.createParallelGroup()
					            .addGroup(GroupLayout.Alignment.LEADING, panelprofLayout.createSequentialGroup()
					                .addComponent(lblcedula, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 70, Short.MAX_VALUE))
					            .addGroup(GroupLayout.Alignment.LEADING, panelprofLayout.createSequentialGroup()
					                .addGroup(panelprofLayout.createParallelGroup()
					                    .addComponent(lblnom, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
					                    .addGroup(GroupLayout.Alignment.LEADING, panelprofLayout.createSequentialGroup()
					                        .addComponent(lblape, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)
					                        .addGap(7)))
					                .addComponent(btnasi, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 0, Short.MAX_VALUE)))
					        .addGap(86)))
					.addContainerGap(76, 76));
					panelprofLayout.setVerticalGroup(panelprofLayout.createSequentialGroup()
					.addContainerGap(21, 21)
					.addGroup(panelprofLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(txtcedula, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
					    .addComponent(lblcedula, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE))
					.addGap(17)
					.addGroup(panelprofLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(txtnom, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
					    .addComponent(lblnom, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
					.addGroup(panelprofLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(txtape, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
					    .addComponent(lblape, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
					.addGroup(panelprofLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(txttitulo, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
					    .addComponent(lbltitulo, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE))
					.addGap(23)
					.addComponent(btnasi, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(45, Short.MAX_VALUE));
			}
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
				.addComponent(panelprof, GroupLayout.PREFERRED_SIZE, 390, GroupLayout.PREFERRED_SIZE));
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
				.addComponent(panelprof, 0, 270, Short.MAX_VALUE));
			pack();
			setSize(400, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}

		acontroladora();
		

	}
	private void acontroladora() {
		
		controp = new ControProfesor(this);
		btnasi.addActionListener(controp);
	
	}
	}
